package com.lzx.orderserver.controller;

import com.lzx.commons.entity.Result;
import com.lzx.commons.utils.ResultUtil;
import com.lzx.orderserver.model.Account;
import com.lzx.orderserver.service.BorrowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 刘正星
 * @version v1.0
 * @package com.lzx.orderserver.controller
 * @data 2022/9/13 23:37
 */
@RestController
@RequestMapping("/account")
public class AccountController {

    @Autowired
    private BorrowService<Account> borrowService;

    @PostMapping("/save")
    public Result save(@RequestBody Account account){
        return ResultUtil.success(borrowService.save(account));

    }

    @GetMapping("/list")
    public Result list(){
        return ResultUtil.success(borrowService.getList());

    }
}
